
#ifndef __OLED_H
#define __OLED_H


#ifdef __cplusplus
extern "C" {
#endif
//#include "hal_function.h"
#include "ssd1306.h"
#include "lvgl.h"

#define OLED_LV_DIS_BUF_SIZE ((sizeof(lv_color_t) * SSD1306_WEIGHT * SSD1306_HEIGHT))

typedef struct
{
    lv_disp_drv_t dis_drv; 
    lv_disp_draw_buf_t draw_buf;
    lv_color_t *disbuf; 
    uint8_t *gram;
}OledHandle;

extern void OLED_DataTObit(int x,int y, int color,void *gram);
extern void OLED_LV_INIT();
extern void OLED_Write(int x,int y,int color);
extern void OLED_UPDATA();

#ifdef __cplusplus
}
#endif
#endif